package cn.yl.fxboot.application.common.utils;

import cn.hutool.core.util.StrUtil;

public class StringUtil extends StrUtil{
	
	/**
	 *  去掉#标签,并添加字符串后缀
	 * @param str
	 * @param suffix
	 * @return
	 */
	public static String removeTag(String str,String suffix) {
    	if(str.contains("#")) {
    		String[] tmp = str.split("#");
    		if(str.startsWith("#")) {
        		str = tmp[tmp.length-1]+suffix;
    		}else {
    			str = tmp[0] + suffix;
    		}
    	}
    	str = str == "" ? System.currentTimeMillis() + "" : str;
    	if(!str.contains(suffix)) {
    		str = str + suffix;
    	}
    	return str.replace(" ", "");
    }
    
	/**
	 * 去掉#标签
	 * @param str
	 * @return
	 */
    public static String removeTag(String str) {
    	if(str.contains("#")) {
    		String[] tmp = str.split("#");
    		if(str.startsWith("#")) {
        		str = tmp[tmp.length-1];
    		}else {
    			str = tmp[0];
    		}
    	}
    	str = str == "" ? System.currentTimeMillis() + "" : str;
    	return str.replace(" ", "");
    }

}
